<?php /* Smarty version 2.6.18, created on 2008-06-13 22:57:03
         compiled from admin/Websetup_usergroupband.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'get_app_inf', 'admin/Websetup_usergroupband.html', 4, false),array('function', 'webcontrol', 'admin/Websetup_usergroupband.html', 164, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
<head>  
<title><?php echo $this->_plugins['function']['get_app_inf'][0][0]->_pi_func_get_app_inf(array('key' => 'siteName'), $this);?>
 - <?php echo $this->_tpl_vars['title']; ?>
</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />  
<!-- add your meta tags here -->  
  
<link href="css/my_layout.css" rel="stylesheet" type="text/css" />
<link href="css/screen/band.css" rel="stylesheet" type="text/css" />  
<!--[if lte IE 7]>  
<link href="css/my_patches/patch_my_layout.css" rel="stylesheet" type="text/css" />  
<![endif]-->  
<script type="text/javascript" src="script/jquery.js"><!-- jQuery 1.2.1 --></script>
<script type="text/javascript" src="script/jquery.form.js"><!-- 表单Ajax插件 --></script>
<script type="text/javascript" src="script/yav.js"><!-- 表单验证插件 --></script>
<script type="text/javascript" src="script/jquery.yav.pack.js"><!-- 表单验证插件 --></script>
<script type="text/javascript" src="script/jquery.confirm.js"><!-- 对话框插件 --></script>
<script type="text/javascript">


// 在网页载入时加载
$(function() {
	
	// 全部角色列表鼠标划过动作
	$("#allRoles li, #allPermissions li, input:submit").hover(function(){
		$(this).addClass("OMover");
	},function(){
		$(this).removeClass("OMover");
	});
	
	
	// 选择一个用户组
	$("#select_usergroup").change(function(){
		$.get("websetup.php",{
			controller      :  'admin_usergroup',
			action          :  'getUgInherit',
			user_group_id   :  $(this).val()
		},function(response){
			list = eval('(' + response + ')');
			// 许可的Roles
			$("#thisuginfo .allow_roles").empty();
			$.each(list.allow.roles, function(i, value){
				$("#thisuginfo .allow_roles").append("<li>" + value + "</li>");
			});
			// 拒绝的Roles
			$("#thisuginfo .deny_roles").empty();
			$.each(list.deny.roles, function(i, value){
				$("#thisuginfo .deny_roles").append("<li>" + value + "</li>");
			});
			// 许可的Permissions
			$("#thisuginfo .allow_permissions").empty();
			$.each(list.allow.permissions, function(i, value){
				$("#thisuginfo .allow_permissions").append("<li>" + value + "</li>");
			});
			// 拒绝的Permissions
			$("#thisuginfo .deny_permissions").empty();
			$.each(list.deny.permissions, function(i, value){
				$("#thisuginfo .deny_permissions").append("<li>" + value + "</li>");
			});
			// 清除选择
			_clearall();
			// 选中自身已有的角色
			if(list.roles){
				$.each(list.roles, function(i, value){
					$("#allRoles span[role_id='" + value.role_id + "']").click();
					$("#allRoles li[role_id='" + value.role_id + "'] option[value='" + value.join_is_include + "']").attr("selected","selected").click();
				});
			}
			// 选中自身已有的权限
			if(list.permissions){
				$.each(list.permissions, function(i, value){
					$("#allPermissions span[permission_id='" + value.permission_id + "']").click();
					$("#allPermissions li[permission_id='" + value.permission_id + "'] option[value='" + value.join_is_allow + "']").attr("selected","selected").click();
				});
			}
			
		});
	});
	
	$("select[name^='is_include'], select[name^='is_allow']").click(function(){
		if($(this).val() == 1){
			$(this).addClass("green");
			$(this).removeClass("red");
		}else{
			$(this).addClass("red");
			$(this).removeClass("green");
		}
	});
		
	
	// 全部角色列表span开关式点击并触发checkbox点击动作
	$("#allRoles span").toggle(function(){
		// 选中复选框
		$("#allRoles li input[role_id='" + $(this).attr("role_id") + "']").attr("checked","on");
		// 为下拉框增加样式
		$("#allRoles li[role_id='" + $(this).attr("role_id") + "'] select").click();
		// 选中整行
		$("#allRoles li[role_id='" + $(this).attr("role_id") + "']").addClass("Select");
		$(this).parent().find("option").click;
	},function(){
		// 清除复选框
		$("#allRoles li input[role_id='" + $(this).attr("role_id") + "']").removeAttr("checked");
		// 恢复下拉框样式
		$("#allRoles li[role_id='" + $(this).attr("role_id") + "'] select").removeAttr("class");
		// 取消选中整行
		$("#allRoles li[role_id='" + $(this).attr("role_id") + "']").removeClass("Select");
	});
	$("#allRoles input:checkbox").click(function(){
		$("#allRoles span[role_id='" + $(this).attr("role_id") + "']").click();
	});

	
	// 全部权限列表span开关式点击并触发checkbox点击动作
	$("#allPermissions span").toggle(function(){
		// 选中复选框
		$("#allPermissions li input[permission_id='" + $(this).attr("permission_id") + "']").attr("checked","on");
		// 为下拉框增加样式
		$("#allPermissions li[permission_id='" + $(this).attr("permission_id") + "'] option:selected").click();
		// 为整行增加样式
		$("#allPermissions li[permission_id='" + $(this).attr("permission_id") + "']").addClass("Select");
	},function(){
		// 清除复选框
		$("#allPermissions li input[permission_id='" + $(this).attr("permission_id") + "']").removeAttr("checked");
		// 恢复下拉框样式
		$("#allPermissions li[permission_id='" + $(this).attr("permission_id") + "'] select").removeAttr("class");
		// 取消整行样式
		$("#allPermissions li[permission_id='" + $(this).attr("permission_id") + "']").removeClass("Select");
	});
	$("#allPermissions input:checkbox").click(function(){
		$("#allPermissions span[permission_id='" + $(this).attr("permission_id") + "']").click();
	});


	
});

// 把角色和权限表单恢复原状
function _clearall(){
	$("#allRoles li[class='Select'] span").click();
	$("#allPermissions li[class='Select'] span").click();
	$("li[class!='Select'] select").removeAttr("class");
}

</script>


</head>  


<body> 
  <div id="page_margins">

    <div id="border-top">
      <div id="edge-tl"></div>
      <div id="edge-tr"></div>
    </div>
    <div id="page">
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

      <div id="main">
        <div id="col1">
          <div id="col1_content" class="clearfix">
				<?php echo $this->_plugins['function']['webcontrol'][0][0]->_pi_func_webcontrol(array('type' => 'menu','name' => 'myMenu'), $this);?>

          </div>
        </div>
        <div id="col3">
          <div id="col3_content" class="clearfix">
            
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_usergroupband_list.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
            
          </div>
          <!-- IE Column Clearing -->
          <div id="ie_clearing"> &#160; </div>
        </div>
      </div>
      <!-- begin: #footer -->
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    </div>
    <div id="border-bottom">
      <div id="edge-bl"></div>
      <div id="edge-br"></div>
    </div>
  </div>
</body>
</html>